package com.atguigu.srb.core.controller.admin;


import com.atguigu.srb.common.result.Result;
import com.atguigu.srb.core.pojo.entity.UserLoginRecord;
import com.atguigu.srb.core.service.UserLoginRecordService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 用户登录记录表 前端控制器
 * </p>
 *
 * @author lsyandwh
 * @since 2022-12-02
 */
@Api(tags = "用户登入日志")
@RestController
@RequestMapping("/admin/core/userLoginRecord")
//@CrossOrigin
public class AdminUserLoginRecordController {

    @Autowired
    private UserLoginRecordService userLoginRecordService;

    @ApiOperation("获取用户日志列表")
    @GetMapping("/listTop50/{id}")
    public Result listTop50(@PathVariable Long id){

        List<UserLoginRecord> list = userLoginRecordService.getByUserId(id);

        return Result.ok().data("list",list);
    }
}

